package com.blb.ssh.service.impl;

import com.blb.ssh.dao.UserDao;
import com.blb.ssh.entity.User;
import com.blb.ssh.exception.BusinessException;
import com.blb.ssh.service.UserService;

	public class UserSerciceImpl implements UserService {
		
		private UserDao userDao;
			
		public void setUserDao(UserDao userDao) {
			this.userDao = userDao;
		}

		public void login(String username, String password)throws BusinessException{
			User user=userDao.getUserByUserName(username);
			if(user==null){
				throw new BusinessException("用户名不存在");
			}
			if(!user.getPassword().equals(password)){
				throw new BusinessException("密码错误");
			}
		}
	}
